#include <iostream>
#include <queue>
#include <string.h>
using namespace std;


struct step{
	int next_right,next_left,length;
	bool operator < (const step x)const{
		return length>x.length;
	}
};


int main(){
	int l,n,m;
	priority_queue<step> q;
	cin>>l>>n>>m;
	int a[n],len[n+1];
	bool vis[n];
	
	
	cin>>a[0];
	vis[0] = true;
	len[0] = a[0]-0;
	step b;
	b.left = 0;
	b.right = 1;
	b.length = a[0]-0;
	q.push(b)
	for(int i=1;i<n;i++){
		cin>>a[i];
		vis[i] = true;
		len[i] = a[i]-a[i-1];
		b.left = i;
		b.right = i+1;
		b.length = len[i];
		q.push(b);
	}
	len[n] = l-a[n-1]+1;
	b.left = n;
	b.right = n+1;
	b.length = len[n];
	q.push(b);
	for(int i=0;i<m;i++){
		step now;
		now = q.top();
		q.pop();
		if(vis[now.left-1] == false  ||  vis[now.right-1] == false){
			i--;
			continue;
		}
		if(len[now.left-1] <= len[now.right]){
			vis[now.left-1] = false;
			len[now.left-1] += len[now.left];
			b.left = now.left-1;
			b.right = now.right;
			b.length = len[now.left-1]
			q.push(b);
		}
		else{
			vis[now.n] = false;
			len[now.n+1] += len[now.n];
		}
	}
	for(int i=0;i<n;i++)
		cout<<vis[i]<<" ";
	cout<<endl;
	int ans=0x7fffffff;
	for(int i=0;i<n-1;i++){
		if(vis[i] == false  ||  vis[i+1] == false)
			continue;
		cout<<i<<" "<<len[i+1]<<endl;
		ans = min(ans,len[i+1]);
	}
	if(vis[0] == true)
		ans = min(ans,len[0]);
	cout<<ans;
	return 0;
}
